package com.ipDev.moyvSys;

import com.ipDev.moyvSys.domain.po.Problem;
import com.ipDev.moyvSys.mapper.ProblemMapper;
import com.ipDev.moyvSys.service.IProblemService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Collections;
import java.util.List;

@SpringBootTest
@Slf4j
public class test4RandomData {

    @Autowired
    private IProblemService problemService;


    @Test
    void test1() {
        //先把所有符合条件的都抽出来
        List<Problem> list = problemService.lambdaQuery().eq(Problem::getSectionId, 1).list();
        log.info("list:{}", list);
        Collections.shuffle(list);
        log.info("after:{}", list);
    }
}
